<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CreateJS export from spacegame</title>

<script src="libs/easeljs-0.4.2.min.js"></script>
<script src="libs/preloadjs-0.1.0.min.js"></script>
<script src="libs/soundjs-0.2.0.min.js"></script>
<script src="spacegame.js"></script>

<script>
var canvas, stage, exportRoot;

function init() {
	canvas = document.getElementById("canvas");

	var manifest = [
		{src:"sounds/HorribleSquawkwav.mp3", id:"HorribleSquawkwav"},
		{src:"sounds/pewwav.mp3", id:"pewwav"}
	];

	var loader = new PreloadJS(false);
	loader.installPlugin(SoundJS);
	loader.onComplete = handleComplete;
	loader.loadManifest(manifest);
}

function handleComplete() {
	exportRoot = new lib.Game();

	stage = new Stage(canvas);
	stage.addChild(exportRoot);
	stage.update();

	Ticker.setFPS(24);
	Ticker.addListener(stage);
}

function playSound(name, loop) {
	SoundJS.play(name, SoundJS.INTERRUPT_EARLY, 0, 0, loop);
}
</script>
</head>

<body onload="init();" style="background-color:#D4D4D4">
	<canvas id="canvas" width="550" height="400" style="background-color:#ffffff"></canvas>
</body>
</html>